package day4.liberary.book1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: watermelon
 * Date: 2025-05-30
 * Time: 21:59
 */
public class book {
    private String name;
    private String author;
    private int price;
    private String type;
    private boolean isborrowed;
    public book(String name,String author,int price,String type)
    {
        this.name=name;
        this.author=author;
        this.type=type;
        this.price=price;
        isborrowed=false;
    }
    public void setName(String name)
    {
        this.name=name;
    }
    public String getName()
    {
        return name;
    }
    public void setAuthor(String author)
    {
        this.author=author;
    }
    public String getAuthor()
    {
        return author;
    }
    public void setType(String type)
    {
        this.type=type;
    }
    public String getType()
    {
        return type;
    }
    public void setPrice(int price)
    {
        this.price=price;
    }
    public int getPrice()
    {
        return price;
    }
    public void setIsborrowed(boolean Isborrowed)
    {
        this.isborrowed=Isborrowed;
    }
    public boolean getIsborrowed()
    {
        return isborrowed;
    }

    @Override
    public String toString() {
        return "{"+"书名:"+name+",类型:"+type+",作者:"+author+",价格:"+price+",是否被借出:"+((!isborrowed)?"flase":"true")+"}";
    }
}
